﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysFile")]
    public class SysFile
    {
        public enum EnumFileMediaType
        {
            Unkown = 0,
            Voice = 1,
            Video = 2,
            Doc = 3,
            Image = 4
        }

        public enum EnumFileStatus
        { 未知 = 0, 在用 = 1, 遗弃 = 2 }

        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid FileId { get; set; }

        [Required]
        [Column(TypeName = "varchar(500)")]
        public string RelativePath { get; set; }

        [Required]
        [Column(TypeName = "varchar(250)")]
        public string Name { get; set; }

        [Required]
        [Column(TypeName = "int8")]
        public long Size { get; set; }

        [Column(TypeName = "varchar(250)")]
        public string Subclass { get; set; }

        [Required]
        [Column(TypeName = "varchar(500)")]
        public string MD5 { get; set; }

        [Required]
        [Column(TypeName = "int4")]
        public EnumFileMediaType MediaType { get; set; }

        [Column(TypeName = "int4")]
        public EnumFileStatus Status { get; set; }

        [Required]
        [Column(TypeName = "bool", Order = 999)]
        public bool IsDeleted { get; set; }

        [Required]
        [Column(TypeName = "varchar(64)", Order = 1000)]
        public string CreatedBy { get; set; }

        [Required]
        [Column(TypeName = "timestamp", Order = 1001)]
        public DateTime CreatedDate { get; set; }

        [Required]
        [Column(TypeName = "varchar(64)", Order = 1002)]
        public string LastUpdatedBy { get; set; }

        [Required]
        [Column(TypeName = "timestamp", Order = 1003)]
        public DateTime LastUpdatedDate { get; set; }
    }
}